package com.galaxy.user.domain.bo;

import com.galaxy.common.core.validate.AddGroup;
import com.galaxy.common.core.validate.EditGroup;
import com.galaxy.common.mybatis.core.domain.BaseEntity;
import com.galaxy.user.domain.UserBase;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;


@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = UserBase.class)
public class UserBaseBo extends BaseEntity {
    /**
     * 用户ID
     */
    @NotNull(message = "用户ID不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 用户编号
     */
    @NotBlank(message = "用户编号不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(max = 32, message = "用户编号长度不能超过32个字符")
    private String userNo;

    /**
     * 微信openid
     */
    @Size(max = 64, message = "微信openid长度不能超过64个字符")
    private String openid;

    /**
     * 支付宝ID
     */
    @Size(max = 64, message = "支付宝ID长度不能超过64个字符")
    private String alipayId;

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(max = 50, message = "用户名长度不能超过50个字符")
    private String username;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空", groups = { AddGroup.class })
    @Size(max = 128, message = "密码长度不能超过128个字符")
    private String password;

    /**
     * 盐值
     */
    @Size(max = 32, message = "盐值长度不能超过32个字符")
    private String salt;

    /**
     * 手机号
     */
    @Size(max = 20, message = "手机号长度不能超过20个字符")
    private String phone;

    /**
     * 邮箱
     */
    @Size(max = 100, message = "邮箱长度不能超过100个字符")
    private String email;

    /**
     * 头像URL
     */
    @Size(max = 255, message = "头像URL长度不能超过255个字符")
    private String avatar;

    /**
     * 状态（0正常 1停用）
     */
    private Integer status;
}
